package com.hzhr.iot.device.controller;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.annotation.Author;
import com.hzhr.iot.core.dto.ResponseExceptionDto;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.device.controller.base.BaseController;
import com.hzhr.iot.device.model.concentrator.ConcentratorDeleteModel;
import com.hzhr.iot.device.model.concentrator.ConcentratorGetModel;
import com.hzhr.iot.device.model.concentrator.ConcentratorPostModel;
import com.hzhr.iot.device.model.concentrator.ConcentratorPutModel;
import com.hzhr.iot.device.service.ConcentratorService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Map;

@Api(tags = "Concentrator", description = "集中器")
@RestController
@RequestMapping(value = "")
public class ConcentratorController extends BaseController {
    @Autowired
    ConcentratorService concentratorService;

    //region /concentrators GET
    //region swagger响应码 : get
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : get
    @ApiOperation(value="查询用户所在物联网设备公司下的集中器", notes="查询用户所在物联网设备公司下的集中器  \n简介 : 查询用户所在物联网设备公司下的集中器  \n步骤 :  \n1. 查询集中器 :  \n根据条件参数查询IotDeviceEntityExt对象列表iotDeviceList_1及总数，  \n额外筛选条件如下：  \n          IotDeviceEntityExt.categoryCode = deviceOptions.getCode('IOT_DEVICE_CATEGORY','CONCENTRATOR')；  \n          IotDeviceEntityExt.companyId = 登录用户.companyId；  \n2. 返回信息 :  \n(1) 根据条件参数，将iotDeviceList_1及总数组装成结果对象result  \n(2) 设置result中ConcentratorModel的部分属性，设置规则如下：  \n          ConcentratorModel.companyName = ConcentratorModel.companyId所关联的user_service.Company_NameModel的name属性(关联关系：ConcentratorModel.companyId = CompanyNameModel.id)  \n          ConcentratorModel.deptName = ConcentratorModel.deptId所关联的user_service.Dept_NameModel的name属性(关联关系：ConcentratorModel.deptId = DeptNameModel.id)  \n",produces = "application/json")
    //endregion
    //region swagger参数 : get
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌", required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_id", value = "筛选条件 : where ConcentratorModel.id = #{equal_id}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_code", value = "筛选条件 : where ConcentratorModel.code = #{equal_code}", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_des", value = "筛选条件 : where ConcentratorModel.des like '%' #{like_des} + '%'", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_createTime", value = "筛选条件 : where ConcentratorModel.createTime >= #{greaterthanorequal_createTime}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_createTime", value = "筛选条件 : where ConcentratorModel.createTime < #{less_createTime}", required = false, dataType = "int", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局", defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_id", value = "筛选条件 : where ConcentratorModel.id = #{_equal_id}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_code", value = "筛选条件 : where ConcentratorModel.code = #{_equal_code}", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_like_des", value = "筛选条件 : where ConcentratorModel.des like '%'#{_like_des} + '%'", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_createTime", value = "筛选条件 : where ConcentratorModel.createTime >= #{_greaterthanorequal_createTime}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_createTime", value = "筛选条件 : where ConcentratorModel.createTime < #{_less_createTime}", required = false, dataType = "int", paramType = "query"),

    })
    //endregion
    //region 请求 : get
    @RequestMapping(value = "/concentrators", method = RequestMethod.GET)
    //endregion
    @Author
    public ResponseEntity<ConcentratorGetModel> get(@RequestParam @ApiIgnore Map<String, Object> query) throws ServiceException {
        ConcentratorGetModel responseBody = concentratorService.get(initHeader(), query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
        //endregion
    }
    //endregion

    //region /v1/concentrators GET
    //region swagger响应码 : get1
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : get1
    @ApiOperation(value="查询集中器", notes="查询集中器  \n简介 : 查询集中器  \n步骤 :  \n1. 查询集中器 :  \n根据条件参数查询IotDeviceEntityExt对象列表iotDeviceList_1及总数，  \n额外筛选条件如下：  \n          IotDeviceEntityExt[i].categoryCode = deviceOptions.getCode('IOT_DEVICE_CATEGORY','CONCENTRATOR')；  \n2. 返回信息 :  \n(1) 设置iotDeviceList_1元素额外属性，设置规则如下：  \n          iotDeviceList_1[i].companyName = iotDeviceList_1[i].companyId所关联的user_service.CompanyNameModel的name属性(关联关系：IotDeviceEntityExt.companyId = CompanyNameModel.id)  \n          iotDeviceList_1[i].deptName = iotDeviceList_1[i].deptId所关联的user_service.DeptNameModel的name属性(关联关系：IotDeviceEntityExt.deptId = DeptNameModel.id)  \n(2) 根据条件参数，将iotDeviceList_1及总数组装成结果对象并返回；  \n",produces = "application/json")
    //endregion
    //region swagger参数 : get1
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌", required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_id", value = "筛选条件 : where ConcentratorModel.id = #{equal_id}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_code", value = "筛选条件 : where ConcentratorModel.code = #{equal_code}", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_des", value = "筛选条件 : where ConcentratorModel.des like '%'#{like_des} + '%'", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_createTime", value = "筛选条件 : where ConcentratorModel.createTime >= #{greaterthanorequal_createTime}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "less_createTime", value = "筛选条件 : where ConcentratorModel.createTime < #{less_createTime}", required = false, dataType = "int", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局", defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_id", value = "筛选条件 : where ConcentratorModel.id = #{_equal_id}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_code", value = "筛选条件 : where ConcentratorModel.code = #{_equal_code}", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_like_des", value = "筛选条件 : where ConcentratorModel.des like '%'#{_like_des} + '%'", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_createTime", value = "筛选条件 : where ConcentratorModel.createTime >= #{_greaterthanorequal_createTime}", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_less_createTime", value = "筛选条件 : where ConcentratorModel.createTime < #{_less_createTime}", required = false, dataType = "int", paramType = "query"),

    })
    //endregion
    //region 请求 : get1
    @RequestMapping(value = "/v1/concentrators", method = RequestMethod.GET)
    //endregion
    @Author
    public ResponseEntity<ConcentratorGetModel> get1(@RequestParam @ApiIgnore Map<String, Object> query) throws ServiceException {
        ConcentratorGetModel responseBody = concentratorService.get1(initHeader(), query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
        //endregion
    }
    //endregion

    //region /concentrators POST
    //region swagger响应码 : post
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
            @ApiResponse(code = 403, message = "----异常代码 : 201  \n----异常类型 : 业务流程异常  \n----异常业务 : 验证集中器代码  \n----异常说明 : 集中器代码已存在  \n\n", response = ResponseExceptionDto.class),
    })
    //endregion
    //region swagger说明 : post
    @ApiOperation(value="新增集中器", notes="新增集中器  \n简介 : 新增集中器  \n步骤 :  \n1. 验证集中器代码 :  \n如果存在IotDeviceEntityExt对象满足以下条件，则抛出异常201：  \n          IotDeviceEntityExt.code = body.code；  \n          IotDeviceEntityExt.categoryCode = deviceOptions.getCode('IOT_DEVICE_CATEGORY','CONCENTRATOR')；  \n2. 创建集中器 :  \n根据body创建IotDeviceEntity对象iotDevice_1，  \n额外属性设置规则如下：  \n          IotDeviceEntity.categoryCode = deviceOptions.getCode('IOT_DEVICE_CATEGORY','CONCENTRATOR')；  \n          IotDeviceEntity.companyId = 登录用户.companyId；  \n          IotDeviceEntity.iotPlatformCode = deviceOptions.getCode('IOT_PLATFORM_TYPE','SELF_BUILD')；  \n          IotDeviceEntity.iotPlatformDeviceId = body.code；  \n          IotDeviceEntity.resourceCode = body.deptId所关联的user_service.DeptModel对象dept_1的resourceCode属性值(关联关系：ConcentratorPostModel.deptId = user_service.DeptModel.id)；  \n3. 返回信息 :  \n根据条件参数查询创建的iotDevice_1对象，根据查询结果组装结果对象并返回；  \n",produces = "application/json")
    //endregion
    //region swagger参数 : post
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌", required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局", defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    //endregion
    //region 请求 : post
    @RequestMapping(value = "/concentrators", method = RequestMethod.POST)
    //endregion
    @Author
    public ResponseEntity<ConcentratorGetModel> post(@RequestParam @ApiIgnore Map<String, Object> query,
                                                     @RequestBody ConcentratorPostModel body) throws ServiceException {
        ConcentratorGetModel responseBody = concentratorService.post(initHeader(), query, body);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
        //endregion
    }
    //endregion

    //region /concentrators/{id} PUT
    //region swagger响应码 : putById
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
            @ApiResponse(code = 403, message = "----异常代码 : 201  \n----异常类型 : 业务流程异常  \n----异常业务 : 查询集中器  \n----异常说明 : 集中器不存在  \n\n----异常代码 : 202  \n----异常类型 : 业务流程异常  \n----异常业务 : 验证修改信息  \n----异常说明 : 集中器代码已存在  \n\n", response = ResponseExceptionDto.class),
    })
    //endregion
    //region swagger说明 : putById
    @ApiOperation(value="更新用户所在物联网设备公司下的集中器", notes="更新用户所在物联网设备公司下的集中器  \n简介 : 更新用户所在物联网设备公司下的集中器  \n步骤 :  \n1. 查询集中器 :  \n查询IotDeviceEntity对象iotDevice_1，筛选规则如下：  \n          IotDeviceEntity.id = 路径参数id；  \n          IotDeviceEntity.companyId = 登录用户.companyId；  \n          IotDeviceEntity.categoryCode = deviceOptions.getCode('IOT_DEVICE_CATEGORY','CONCENTRATOR')；  \n如果iotDevice_1不存在，抛出异常201；  \n2. 验证修改信息：  \n(1) 验证集中器代码：  \n          如果body.code != iotDevice_1.code，并且存在IotDeviceEntity满足以下条件，则抛出异常202：  \n              IotDeviceEntity.code = body.code；  \n3. 修改集中器 :  \n根据body更新iotDevice_1，  \n额外属性设置规则如下：  \n          iotDevice_1.resourceCode = body.deptId所关联的user_service.DeptModel对象dept_1的resourceCode属性值(关联关系：user_service.ConcentratorPostModel.deptId = DeptModel.id)；  \n3. 返回信息 :  \n根据条件参数查询更新后的iotDevice_1对象，根据查询结果组装结果对象并返回；  \n",produces = "application/json")
    //endregion
    //region swagger参数 : putById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌", required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "int", paramType = "path"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局", defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    //endregion
    //region 请求 : putById
    @RequestMapping(value = "/concentrators/{id}", method = RequestMethod.PUT)
    //endregion
    @Author
    public ResponseEntity<ConcentratorGetModel> putById(@PathVariable("id") Integer id,
                                                        @RequestParam @ApiIgnore Map<String, Object> query,
                                                        @RequestBody ConcentratorPutModel body) throws ServiceException {
        ConcentratorGetModel responseBody = concentratorService.putById(initHeader(), id, query, body);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
        //endregion
    }
    //endregion

    //region /concentrators/{id} DELETE
    //region swagger响应码 : deleteById
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : deleteById
    @ApiOperation(value="删除用户所在物联网设备公司下的集中器", notes="删除用户所在物联网设备公司下的集中器  \n简介 : 删除用户所在物联网设备公司下的集中器  \n步骤 :  \n1. 删除集中器 :  \n逻辑删除IotDeviceEntity对象，筛选规则如下：  \n          IotDeviceEntity.id = 路径参数id；  \n          IotDeviceEntity.companyId = 登录用户.companyId；  \n          IotDeviceEntity.categoryCode = deviceOptions.getCode('IOT_DEVICE_CATEGORY','CONCENTRATOR')；  \n2. 返回信息 :  \n创建结果对象result,属性设置规则如下：  \nresult.changeCount = 删除数量  \n",produces = "application/json")
    //endregion
    //region swagger参数 : deleteById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌", required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "int", paramType = "path"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号", required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型", required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局", defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : deleteById
    @RequestMapping(value = "/concentrators/{id}", method = RequestMethod.DELETE)
    //endregion
    @Author
    public ResponseEntity<ConcentratorDeleteModel> deleteById(@PathVariable("id") Integer id,
                                                              @RequestParam @ApiIgnore Map<String, Object> query) throws ServiceException {
        ConcentratorDeleteModel responseBody = concentratorService.deleteById(initHeader(), id, query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
        //endregion
    }
    //endregion
}
















































































































































































































































































































































































































































































































































































































